PHP_SOURCES := $(wildcard include/*.php)

all: clean syntax locales doxy

# Remove useless file
clean:
	@echo "----------------"
	@echo "Remove useless file :"
	@find . -name "*~" -exec rm {} \;
	@echo "done"

# Check PHP syntax on all php files
syntax: $(PHP_SOURCES)
	@echo "----------------"
	@echo "Check PHP syntax on all php files :"
	@for i in $(PHP_SOURCES); do php -l $$i; done;
	@echo "done"

# Generate gettext mo files
locales:
	$(MAKE) -C app/locales/

# Generate doxygen doc
doxy: $(PHP_SOURCES)
	$(MAKE) -C doc/


# List all files and directory in doc directory
list:
	find . -type d > doc/directory_list
	find . > doc/file_list
